import common from './common';
import XEUtils from "xe-utils";
import VXETable from "vxe-table";
// 创建一个下拉表格渲染
VXETable.renderer.add("vDownTreesAndListsDialog", {
    autofocus: ".vxe-input--inner",
    renderEdit(h, renderOpts, params) {
        // eslint-disable-next-line no-unused-lets
        const { row, column } = params;
        const { attrs, props } = renderOpts;
        let cellValue = XEUtils.get(row, column.property);
        return [
            h("v-down-trees-and-lists-dialog", {
                attrs: attrs,
                props: Object.assign(props, { params, value: cellValue }),
                on: common.getEditOns(renderOpts, params),
                nativeOn: common.getNativeOns(renderOpts, params)
            })
        ];
    },
    // 可编辑显示模板
    renderCell (h, renderOpts, params) {
        const { row, column } = params;
        const { attrs, props } = renderOpts;
        let cellValue = XEUtils.get(row, column.property);
        return [
            // h('el-button', {
            //     attrs: attrs,
            //     props: $.extend({}, props, { params, value: cellValue }),
            //     on: common.getEditOns(renderOpts, params),
            //     nativeOn: common.getNativeOns(renderOpts, params)
            // }, '仓位')
            h('vDownTreesAndListsDialog', {
                attrs: attrs,
                props: $.extend({}, props, { params, value: cellValue }),
                on: common.getEditOns(renderOpts, params),
                nativeOn: common.getNativeOns(renderOpts, params)
            })
        ];
    }
});
